﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace GUI
{
    public partial class FormChiTietKhachHang : Form
    {
        public int maKhachHang;
        public FormChiTietKhachHang()
        {
            InitializeComponent();
        }

        private void FormChiTietKhachHang_Load(object sender, EventArgs e)
        {
            //load thông tin khach hang
            KhachHangDTO khachhangDTO = KhachHangBUS.ThongTinTaiKhoan(maKhachHang);
            if (khachhangDTO != null)
            {
                lbMaKhachHang.Text = khachhangDTO.MaKhachHang.ToString();
                lbMatKhau.Text = khachhangDTO.MatKhau.ToString();
                lbEmail.Text = khachhangDTO.Email.ToString();
                lbEmailPhu.Text = khachhangDTO.EmailPhu.ToString();
                lbDiaChi.Text = khachhangDTO.DiaChi.ToString();
                lbDienThoai.Text = khachhangDTO.DienThoai.ToString();
                lbTenKhachHang.Text = khachhangDTO.TenKhachHang.ToString();
                lbTinhTrang.Text = khachhangDTO.TinhTrang.ToString();
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void FormChiTietKhachHang_Resize(object sender, EventArgs e)
        {
            pnMain.Location = new Point((this.Width - pnMain.Width) / 2, pnMain.Location.Y);
            if (WindowState == FormWindowState.Maximized)
            {
                this.ShowIcon = false;
            }
            else
            {
                this.ShowIcon = true;
            }
        }

      
    }
}
